package com.stu.service.permission.impl;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.stu.entity.permission.User;
import com.stu.service.base.impl.BaseService;
import com.stu.service.permission.IUserService;

@Service
public class UserService extends BaseService<User>implements IUserService {

	@Override
	public User login(String account, String pwd) throws SQLException {
		String hql="FROM User WHERE account=:acc and pwd=:pass";
		Map<String,Object>params=new HashMap<String,Object>();
		params.put("acc", account);
		params.put("pass", pwd);
		List<User>user=baseDao.findByHql(hql, params);
		return user!=null&&user.size()>0?user.get(0):null;
	}


}
